
<template>
	<!-- 添加每日菜品 -->
	<div>
		<el-row>
			<el-col :span="colWidth.col1">
				<span class="formLable must">通知标题</span>
			</el-col>
			<el-col :span="colWidth.col2">
				<el-input v-model="saveParam.title" maxlength="30"></el-input>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="colWidth.col1">
				<span class="formLable must">通知内容</span>
			</el-col>
			<el-col :span="colWidth.col2">
				<el-input type="textarea" v-model="saveParam.content" :rows="6" maxlength="300" show-word-limit></el-input>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="colWidth.col1">
				<span class="formLable must">是否要家长确认</span>
			</el-col>
			<el-col :span="colWidth.col2">
				 <el-radio-group v-model="saveParam.isConfirm">
					<el-radio :label="1">是</el-radio>
					<el-radio :label="0">否</el-radio>
				</el-radio-group>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="colWidth.col1">
				<span class="formLable must">上传图片</span>
			</el-col>
			<el-col :span="colWidth.col2">
				<imageUpload ref="imageUpload" :type="'images'" :maxSize="2" :maxCount="3" v-model="saveParam.imageList"></imageUpload>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="colWidth.col1">
				<span class="formLable must">通知班级</span>
			</el-col>
			<el-col :span="colWidth.col2">
				<el-select v-model="saveParam.classList" placeholder="请选择">
					<el-option label="班级通知" value="1"></el-option>
					<el-option label="园所通知" value="2"></el-option>
				</el-select>
			</el-col>
		</el-row>
		
		<el-row style="text-align:center;">
			<el-button @click="cancle">取消</el-button>
			<el-button @click="apply">保存并发送</el-button>
			<el-button @click="save">保存</el-button>
		</el-row>
	</div>
</template>

<script>
	let vm;
	import imageUpload from '@/components/common/image_upload'
	export default{
		components:{imageUpload},
		data(){
			return {
				isEdite:true,
				colWidth:{
					col1:5,
					col2:19
				},
				saveParam:{
					title:'',
					content:'',
					isConfirm:1,
					imageList:[],
					classList:[]
				},
			}
		},
		methods:{
			init(data,edite){
				
				if(data){
					
				}
			},
			cancle(){
				this.$emit('cancle',false);
			},
			apply(){
				// console.log(this.saveParam.imageList);
			},
			save(){
				// let length=this.selectData.length;
				// if(length<=0){
				// 	this.$message({
				// 		type:'warning',
				// 		message:'请选择餐点！'
				// 	})
				// 	return;
				// }
				
				// for(let i=0;i<length;i++){
				// 	let ref='imageUpload'+i;
				// 	let url=this.$refs[ref][0].getImagesUrl();
				// 	this.selectData[i].imageUrl=url[0];
				// }

				this.$emit('cancle',false);
			},
		},
		mounted(){
			vm=this;
		},
		computed:{
			
		},
		watch:{

		}
	}
</script>

<style lang="scss" scoped>
	.formLable,.formValue{
		font-size: 0.16rem;
		line-height: 0.4rem;
	}
	.formLable.must::before{
		content: '*';
		color: red;
		margin: 0 0.05rem;
	}
	.el-row{
		margin-bottom: 0.16rem;
	}
	.el-checkbox{
		font-size: 0.16rem;
		line-height: 0.4rem;
	}
	.el-radio{
		font-size: 0.16rem;
		line-height: 0.4rem;
	}
</style>